package study.saas.order.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import study.saas.common.viewmodel.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import java.math.BigDecimal;

@Entity
@Data
@Table(name = "purchase",indexes = {
        @Index(name = "purchaseId_index",columnList = "purchaseId")
})
/**
 * 创建commodity的实体类
 * @author HuBoyu
 */
public class Purchase extends BaseEntity {

    @Column
    @ApiModelProperty(value = "订单id")
    private Integer purchaseId;

    @Column //商品id
    @ApiModelProperty(value = "商品ID")
    private Integer id;

    @Column
    @ApiModelProperty(value = "商品数量")
    private Integer /**类int型 可在int和string类型中转换  */amount; // 商品数量

    @Column
    @ApiModelProperty(value = "商品名称")
    private String purchaseName; // 商品名称

    @Column
    @ApiModelProperty(value = "商品价格")
    private BigDecimal price; // 商品价格



}
